<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>8款纯CSS3搜索框</title>

    <link href="http://cdn.bootcss.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet">
    <link rel="stylesheet" href="style.css">
    <style>


        /*搜索框7*/
        .bar7 {background: #7BA7AB;}
        .bar7 form {
            height: 42px;
            position: relative;
            width: 30px;
            margin: 0 auto;
        }
        .bar7 input {
            width: 180px;
            border-radius: 42px;
            border: 2px solid #324B4E;
            background: #F9F0DA;
            transition: .3s linear;
            float: right;
            height: 42px;
            padding-left: 13px;
            border: none;
            outline: none;
        }
        .bar7 input:focus {
            width: 240px;
        }
        .bar7 button {
            background: none;
            top: -2px;
            right: 0;
            height: 42px;
            width: 42px;
            cursor: pointer;
            position: absolute;
            border: none;
            outline: none;
        }
        .bar7 button:before{
          content: "\f002";
          font-family: FontAwesome;
          color: #324b4e;
        }
    </style>
</head>
<body>
<div id="container">
    <div class="search bar7">
        <form>
            <input type="text" placeholder="请输入您要搜索的内容...">
            <button type="submit"></button>
        </form>
    </div>
</div>
</body>
</html>